package com.si.util;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;

public class  QueryWhere {

	private  static HashSet<Criterion> queryList=new HashSet<Criterion>();
	private  static HashSet<String> aliasSet=new HashSet<String>();
	private  static List<Order> orderList=new ArrayList<Order>();

	public static void push(Criterion criterion){
		queryList.add(criterion);
	}
	public static List<Criterion> getQueryList(){
		return new ArrayList<Criterion>(queryList);
	}

	public  static void remove(){
		queryList=new HashSet<Criterion>();
		aliasSet=new HashSet<String>();
		orderList=new ArrayList<Order>();
	}



	public static void alias(String alias){
		aliasSet.add(alias);
	}

	public static List<String> getAliasList(){
		return new ArrayList<String>(aliasSet);
	}

	public static void setOrderList(Order order) {
		orderList.add(order);
	}

	public static List getOrderList() {
		return orderList;
	}

}
